package collections;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Random;

public class array {
	
	public static void main(String[] args){
	                
	      //  ArrayList<String> list1=new ArrayList<String>();
		long start=System.currentTimeMillis();
	     System.out.println("\n"+start);
	       
	     Random s = new Random();
	     	String[] sList = new String[10];
	       sList[0]= new String("name 1");
	       sList[1]= new String("name 2");
	       sList[2]= new String("name 3");
	       sList[3]= new String("name 4");
	       sList[4]= new String("name 5");
	       
	          
	        	       
	        String list = sList[(s.nextInt(sList.length))];
	        ArrayList<String> list1=new ArrayList<String>(Arrays.asList(list));
	        System.out.println("\nList of list1: "+list1);
	       // System.out.println(list1);
		     
		     sList[7] = new String("name 7");
		     list1=new ArrayList<String>(Arrays.asList(list));
		     System.out.println("\nList of list1 affter adding: "+list1);
		     
		     
		      
		     long end=System.currentTimeMillis();
		     System.out.println(end);
		     
		     System.out.println("\n"+(end-start));
		    
		
		     

		  }	
}

